{meta_html js $j_basepath.'design/front/js/popup.js'}

<!--[if lte IE 9]>
		<link rel="stylesheet" href="{$j_basepath}design/front/css/ie9.css" type="text/css" />                            
	<![endif]-->
	<!--[if lte IE 8]>
		<link rel="stylesheet" href="{$j_basepath}design/front/css/ie8.css" type="text/css" />                            
	<![endif]-->
    {literal}
        <style type="text/css">
            a.lien_feerique {
                height: 408px;
                left: 160px;
                top: 75px;
                position: absolute;
                width: 199px;
                z-index: 10;
            }
            a.lien_dynamique {
                height: 408px;
                left: 371px;
                position: absolute;
                width: 199px;
                z-index: 10;
                top: 75px;
            }
            a.lien_basique {
                height: 268px;
                left: 584px;
                position: absolute;
                width: 199px;
                z-index: 10;
                top: 75px;
            }
			
        </style>
    {/literal}
{literal}
	<style>
    	#essai_fiche .chapitre p, td{font-size:12px;}
    </style>
{/literal}
<div id="global" class="search"> {$oZoneHeader}
  <div id="main">
    <div class="file_ariane"> {$oZoneBreadCrumb} </div>
    
    <!-- begin leftContent2-->
    <div id="leftContent4">
      <div id="essai_fiche">
        <h2>Gérer votre annonce</h2>
        <div class="wrap7">
          <div class="block coordonnees">
            <ul class="menu2 vs">
              <li><a class="aCc2" href="{jurl 'annonce~FoAnnonceGestion:gererAnnonce',array('idOccasion'=>$idOccasion)}">Accueil</a></li>
              <li><a class="mod22" href="{jurl 'annonce~FoAnnonceGestion:edit',array('idOccasion'=>$idOccasion)}">Modifier</a></li>
              <li><a class="fOpt2 active">Formule/Option</a></li>
              <li><a class="pht2" href="{jurl 'annonce~FoAnnonceGestion:photos',array('idOccasion'=>$idOccasion)}">Photos</a></li>
              <li><a class="vIsu2" href="{jurl 'recherche~FoFiche:index',array('id'=>$idOccasion )}" target="_blank">Visualiser</a></li>
              <li><a class="mod222" href="{jurl 'annonce~FoAnnonceGestion:relancer',array('idOccasion'=>$idOccasion)}">Relancer</a></li>
              <li class="last"><a class="sUp2" href="{jurl 'annonce~FoAnnonceGestion:supprimer',array('idOccasion'=>$idOccasion)}">Supprimer</a></li>
            </ul>
       <br />
            <div id="scrollFiche">
           <div id="leftContent2" style="width:664px; margin:0 auto; float:none;">
                {assign $linkPaiement = LINK_PAIEMENT_CB}
                <form action="{$linkPaiement}" method="post"  id="form-cb" name="form-cb" >
                     <div class="modePay">
                        <ul>
                           <li class="paiement-type" style ="list-style-type: none;">
                                <!-- A commenter ds la version prod-->
                                <INPUT TYPE = hidden NAME = PBX_PAYBOX VALUE = 'https://preprod-tpeweb.paybox.com/cgi/MYchoix_pagepaiement.cgi'>
                                <INPUT TYPE = hidden NAME = PBX_BACKUP1 VALUE = 'https://preprod-tpeweb.paybox.com/cgi/MYchoix_pagepaiement.cgi'>
                                <INPUT TYPE = hidden NAME = PBX_BACKUP2 VALUE = 'https://preprod-tpeweb.paybox.com/cgi/MYchoix_pagepaiement.cgi'>
                                <!-- Fin comments-->
                                <INPUT TYPE = hidden NAME = PBX_MODE VALUE = '1'>
                                <INPUT TYPE = hidden NAME = PBX_SITE VALUE = '0765493'>
                                <INPUT TYPE = hidden NAME = PBX_RANG VALUE = '01'>
                                <INPUT TYPE = hidden NAME = PBX_TOTAL VALUE =""  id="montant" >
                                <INPUT TYPE = hidden NAME = PBX_DEVISE VALUE = '978'>
                                <INPUT TYPE = hidden NAME = PBX_IDENTIFIANT VALUE = '507127633'>
                                
                                <INPUT TYPE = hidden NAME = PBX_CMD VALUE = "3">
                                <INPUT TYPE = hidden NAME = PBX_PORTEUR VALUE ="{$vendeur}">
                                <INPUT TYPE = hidden NAME = PBX_RETOUR VALUE = 'montant:M;ref:R;auto:A;trans:T;'>
                                <INPUT TYPE = hidden NAME = PBX_EFFECTUE VALUE ="" id ="effectue" class="biby">
                                <INPUT TYPE = hidden NAME = PBX_REFUSE VALUE = "{$pathregret}">
                                <INPUT TYPE = hidden NAME = PBX_ANNULE VALUE = "{$pathregret}">
                                <INPUT TYPE = hidden NAME = PBX_ERREUR VALUE = "{$patherror}"> <!-- Si erreur, redirection sur cette page avec le code d'erreur-->
                                <INPUT TYPE = hidden NAME = "tarif"  VALUE = "" id="tarif">
                                <INPUT TYPE = hidden NAME = "formule"  VALUE ="" id="formule">
                                <input type="hidden" id="urlRetour"  value="{jurl 'annonce~FoAnnonceGestion:ajaxGetFormuleOptions'}" />
                                <input type="hidden" id="urlRetourDefaut"  value="{$urlRetourDefaut}" />
                                <input type="hidden" id="annonceId"  value="{$idOccasion}" />
                            </li>
                        </ul>
                     </div>
                                                                
               </form>
               <form id='form1' action="{jurl 'annonce~FoAnnonceGestion:saveFormuleOptionsEdited'}" method="post" name="form1">
                <input type="hidden"  name="idOccasion" id="idOccasion" value="{$idOccasion}" />
                <input type="hidden" id="choix" name="choix" value="" />
                <input type="hidden" id="choix-form-deb" name="" value="{$formuleSelected->id}" />
                <input type="hidden" id="choix-form" name="choix-form" value="{$formuleSelected->id}" />
                <input type="hidden" id="prix-form"  name="prix-form" value="" />
                <input type="hidden" id="id-formule" name="id-formule" value="" />
                <input type="hidden" id="urlUpdate"  value="{jurl 'annonce~FoAnnonceGestion:ajaxGetChoicesOptionsByFormuleId'}" />
                <input type="hidden" id="packChose" name="packChose" value="0" />

                
                <div id="detailOption" style="margin:0;padding:0;overflow-y: auto;overflow-x: hidden;">
                   <p class="titre">Détails des options de l'annonce</p>
                   <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top:8px;">
                       <tr><td width="45%">Options de la formule</td><td width="45%">Options supplémentaires de l'annonce</td></tr>
                       <tr>
                           <td valign="top" id="recapFormule">
                               <ul>
                                    {foreach $recapAnnonceFormule as $key=>$itemRecap}
                                        <li>{$itemRecap->lib_option_formule} : {$itemRecap->formch_libelle}</li>
                                    {/foreach}
                                </ul>
                           </td>
                           <td valign="top" id="recapAnnonce">
                               <ul>
                                    {foreach $recapAnnonceChoix as $key=>$itemRecap}
                                        <li>{$itemRecap->lib_option_formule} : {$itemRecap->formch_libelle}</li>
                                    {/foreach}
                                </ul>
                           </td>
                       </tr>
                   </table>
                       
                </div>
                
                <div id="formule" style="">
                   <p class="titre">Les formules</p>
                        <div style="margin:-33px 0 0;">
                            {foreach $formule as $k=>$itemFormule}
                                <input type="hidden" name="formule{$k}" value="{$itemFormule->id}" class="my-form"/>
                                <input type="hidden" class="selectionne" value="{if ($formuleSelected->id == $itemFormule->id)}1{else}0{/if}" />
                                <input type="hidden" class="a_griser" value="{if ($formuleSelected->prix > $itemFormule->prix)}1{else}0{/if}" />
                               
                              {$itemFormule->content}
                              
                            {/foreach}
                        </div>
                    <p id="error" style="color:red;display:none;"></p>
                </div>
                {if sizeof($optPrixSup->listeLibOption)}
                    {assign $display = '1'}
                {else}
                    {assign $display = '0'}
                {/if}
                 <div id="options" style="clear:both;{if $display}display:block;{else}display:none;{/if}" >
                	<br />
                    <p class="titre">Les options</p>
                    <br />
                    <table id="tableOptions"  border="1" style="border-collapse:collapse">
                    <tr><td>Nom</td><td>Libellé</td><td>Description</td><td>Prix</td><td>Durée</td><td>Action</td></tr>
                    <tr><input type="hidden" id="packChose" value="0"></tr>
                    {foreach $optPrixSup->listeLibOption as $key => $val}
                            {if sizeof($optPrixSup->listeChoix)}
                                {foreach $optPrixSup->listeChoix as $key2 => $valChoix}
                                    {if $val == $valChoix->lib_option_formule}
                                    <tr>
                                        <td>
                                            {$valChoix->lib_option_formule}
                                        </td>
                                         <td>
                                            {$valChoix->formch_libelle|escxml}
                                        </td>
                                        <td>
                                            {$valChoix->formch_description|escxml}
                                        </td>
                                        <td>
                                           {if $valChoix->formch_prix}{$valChoix->formch_prix}€ {/if}
                                        </td>
                                        <td>
                                           {if $valChoix->formch_duree}{$valChoix->formch_duree} j{/if}
                                        </td>
                                        <td  style="width:50px">
                                            <input type="checkbox" statut="0"  optionPrix ="{$valChoix->formch_prix}" value="{$valChoix->formch_id}" style="width:50px;" onclick="miditra(this.value,{$valChoix->formch_prix},this)" id="parution_{$key}"  class="select_choix">
                                        </td>
                                      </tr>
                                    {/if}
                                {/foreach}
                            {/if}
                    {/foreach}
                    </table>
                </div> 
                 {if sizeof($optPrixSup->listePaiement)}
                    {assign $displayP = '1'}
                {else}
                    {assign $displayP = '0'}
                {/if}
                <div id="typepayement" style="clear:both;position: relative;margin-top:62px;{if $displayP}display:block;{else}display:none;{/if}">
                    <p class="titre" style="margin-bottom:20px;">Choix des paiements</p>
                    <label>Type de paiement : </label>
                    <select name="typePayement" id="selectPaiement">
                    {foreach $optPrixSup->listePaiement as $key=>$item}
                             <option value="{$item->id}" {if (isset($typePayement) && ($typePayement == $item->id))} selected {/if}>{$item->paiement}</option>    
                    {/foreach}
                    </select>
                </div>    
                <br />
                <div id="reglement" style="clear:both;position:relative;top:47px;{if $displayP}display:none;{else}display:block;{/if}">
                <p>&nbsp;<a href="#" class="showErrCode">&nbsp;</a></p> <!-- useful for popup when error code -->
                    <p class="titre" style="margin-bottom:20px;">Choix du règlement</p>
                    <label>&nbsp; </label>
                    <select name="typepayement" id="reglement">
                    {foreach $reglement as $key=>$item}
                             <option value="{$item->id}">{$item->paiement}</option>    
                    {/foreach}
                    </select>
                </div>    
                    <div style="clear:both">&nbsp;</div>
         </form>
                        
                <dl style="text-align:center; margin-top:25px;">
                       <input type="image" title="Enregistrer" id='valid-form' onClick="return verifierForm()" src="{$j_basepath}design/front/images/btn_enregistrer.png">
                </dl>

    </div><!--end leftContent2-->
    <div id="rightContent" class="annVisus" style="width:302px; overflow:visible !important; height:auto !important;">
    
     
    </div>
    <div class="clear">&nbsp;</div>
    </div><!--end scrollFiche-->
          </div>
                <div class="more_link2" style="margin-top:50px;"><a class="haut" href="#global">Haut page</a></div>
        </div>
        <div class="deco7">&nbsp;</div>
      </div>
    </div>
    <!-- end leftContent2-->
    
    <div class="clear">&nbsp;</div>
  </div>
  <div id="SideBar"><a href="#global"><img alt="" src="{$j_basepath}design/front/images/top.png" title="" /></a></div>
</div>
{$oZoneFooter}

<div id="popErrCode" class="pop-up cgv" style="left:287px;"> <a href="#" class="close" style="float:right;margin-right:20px;">Fermer</a>
    <h2>Erreur de la transaction</h2>
    <p>{$codeErr}</p>
    <div class="clear">&nbsp;</div>
</div>

{if $err}

<script type="text/javascript">
{literal}
    $(function(){
        $('.showErrCode').click();
        $('#popErrCode').css('left', '287px');
    });
{/literal}
</script>
{/if}
<div id="masque"></div>


{literal}
<style type="text/css">
   .leftItem1 .options {
        display: block;
        width:200px;
    }
    .leftItem1{
       width:267px;
    }
    #la_feerique, #la_dynamique, #la_basique {
        left: 11px;
        position: relative;
        top: 48px;
    }
    #options{
        position: relative;
        top: 50px;
    }
    .select_choix{
        width:160px;
    }
    .td_right{
        text-align:right;
    }
    .submit{
        margin: 100px 0 0 150px;
    }
</style>
{/literal}
    